<?php

//包含公共文件
//include 'D:/mybbs_1702/common/common.php';


//接收big参数
$bigId = isset($_GET['bigId']) ? $_GET['bigId'] : '';

//遍历版块表  [帖子总数,也可通过 category表获取]
$resBody = mySelect($link , '*', DB_TABLE_CG , 'where cisdel=0  order by orderby desc');
//var_dump($resBody);

//将lastpost=1 的帖子置顶 (根据最大时间戳实现)
$resTop = mySelect($link, '*' , DB_TABLE_DETAIL , "where first=1 and  lastpost=1 and isdel=0");		
//var_dump($resTop);

//查询帖子表的帖子总条数,会员总人数,最新注册的用户(只显示一位)  
$postCount = myCount($link , 'id' , DB_TABLE_DETAIL, "where first=1 and isdel=0");
$userCount = myCount($link , 'uid' , DB_TABLE_USER , "where uisdel=0");
$lastUser = mySelect($link , 'username' , DB_TABLE_USER, "where  uisdel=0  order by regtime desc limit 0,1");

// var_dump($postCount);
// var_dump($userCount);
// var_dump($lastUser);

//遍历用户表
$resUser = mySelect($link , '*' , DB_TABLE_USER , "where uisdel=0");
//var_dump($resUser);


//打包数组
$arr = compact('webSite', 'docRoot' , 'bigId' , 'resBody', 'resTop','postCount' , 'userCount' , 'lastUser','resUser');
//发送
display('body.html', $arr);